package com.hm.service.controller.chat;

import com.hm.service.framework.request.post.PostBase;
import com.hm.service.framework.request.post.PostHandleBean;
import com.hm.service.framework.response.ResponseConstant;
import com.hm.service.pojo.response.CaptchaResponse;
import com.hm.service.service.captcha.ICaptchaService;
import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping(value = "/Chat", produces = {"application/json;charset=UTF-8"})
public class CFSS_000_000_002 extends PostBase {
    private static final Logger logger = LoggerFactory.getLogger(CFSS_000_000_002.class);

    private final ICaptchaService captchaService;

    public CFSS_000_000_002(ICaptchaService iCaptchaService) {
        this.captchaService = iCaptchaService;
    }

    //获取验证码接口
    @PostMapping(value = "/000_000_002")
    public String doPost(HttpServletRequest request) {
        return handleRequest(request);
    }

    @Override
    protected String postRequest(PostHandleBean reqBean) {
        CaptchaResponse captcha = captchaService.getCaptcha();
        return successResponse(reqBean.getRealSecretKey(), ResponseConstant.SUCCESS_CODE, "查询成功", captcha);
    }
}
